import { t as $t } from '../../../language/index'

// 商品类型
export const IMG_TEXT = 'ITX'; // 图文
export const AUDIO = 'ADO'; // 音频
export const VIDEO = 'VDO'; // 视频
export const LIVE = 'ALV'; // 直播
export const MEMBER = 'MMB'; // 会员
export const SPECIAL_COLUMN = 'SPC'; // 专栏
export const ASSOCIATION = 'CMN'; // 圈子
export const BIG_SPECIAL_COLUMN = 'BSC'; // 大专栏
export const PUNCH_CARD = 'PCD'; // 打卡
export const E_BOOK = 'EBK'; // 电子书
export const ENTITY_GOODS = 'ENT'; // 实物商品
export const SVIP = 'SVP'; // 超级会员
export const TRAINING_CAMP = 'TCP'; // 训练营
export const TRAINING_CAMP_PRO = 'EKC'; // 训练营pro
export const OFFLINE_CLASS = 'OLC'; // 线下课
export const OFFLINE_PERIOD = 'OLP'; // 课时包
export const BAN_TAK = 'BTK'; // 班课
export const EXERCISE = 'ECS'; // 练习
export const LARGE_CLASS = 'LGC'; // 大班课
export const VALUE_COUPON = 'VCP'; // 有价优惠券
export const AI_CLASS = 'ALC'; // ai互动课
export const SERVICE_GOODS = 'SRV'; // 服务类商品
export const ACTIVITY_MANAGE = 'ATV';//活动管理
export const PRACTICE = 'PCT'; // 练习
export const COURSE = 'Course'; //新课程的训练营pro
export const COP_GOODS = 'COP'; // 组合商品



// 营销活动类型
export const MARKETING_LIMIT_DISCOUNT = 3; // 限时折扣
export const MARKETING_FRIEND_HELP = 4; // 好友助力
export const MARKETING_FISSION_POSTER = 5; // 裂变海报
export const MARKETING_TEAM_BUY = 6; // 拼团
export const MARKETING_SEC_KILL = 8; // 秒杀
export const MARKETING_CUT_PRICE = 10; // 砍价
export const MARKETING_SVIP = 23; //超级会员

// 资源类型key-value
// 只读取中文文案，适用于只需要中文不想被多语言的场景。
// 如需多语言请使用带TKEYS的对象+computed解决。其他的类似不再赘述。
export const RESOURCE_TYPES = {
    [IMG_TEXT]: $t('spuType_graphic'),
    [AUDIO]: $t('spuType_audio'),
    [VIDEO]: $t('spuType_video'),
    [LIVE]: $t('spuType_live'),
    [MEMBER]: $t('spuType_member'),
    [SPECIAL_COLUMN]: $t('spuType_column'),
    [ASSOCIATION]: $t('spuType_community'),
    [BIG_SPECIAL_COLUMN]: $t('spuType_bigColumn'),
    [PUNCH_CARD]: $t('spuType_clock_in'),
    [E_BOOK]: $t('spuType_eBook'),
    [TRAINING_CAMP]: $t('spuType_training'),
    [TRAINING_CAMP_PRO]: $t('spuType_training_pro'),
    [OFFLINE_CLASS]: $t('spuType_offLine'),
    [OFFLINE_PERIOD]: $t('spuType_course_pack'),
    [LARGE_CLASS]: $t('spuType_large_class'),
    [BAN_TAK]: $t('spuType_class'),
    [EXERCISE]: $t('spuType_practice'),
    [ENTITY_GOODS]: $t('spuType_entity'),
    [SVIP]: $t('spuType_svip'),
    [VALUE_COUPON]: $t('spuType_coupon'),
    [AI_CLASS]: $t('spuType_AI_class'),
    [SERVICE_GOODS]: $t('spuType_serviceGoods'),
    [ACTIVITY_MANAGE]:$t('spuType_activitymanage')
};

// 资源类型i18n keys
export const RESOURCE_TYPES_TKEYS = {
    [IMG_TEXT]: 'spuType_graphic',
    [AUDIO]: 'spuType_audio',
    [VIDEO]: 'spuType_video',
    [LIVE]: 'spuType_live',
    [MEMBER]: 'spuType_member',
    [SPECIAL_COLUMN]: 'spuType_column',
    [ASSOCIATION]: 'spuType_community',
    [BIG_SPECIAL_COLUMN]: 'spuType_bigColumn',
    [PUNCH_CARD]: 'spuType_clock_in',
    [E_BOOK]: 'spuType_eBook',
    [TRAINING_CAMP]: 'spuType_training',
    [TRAINING_CAMP_PRO]: 'spuType_training_pro',
    [OFFLINE_CLASS]: 'spuType_offLine',
    [OFFLINE_PERIOD]: 'spuType_course_pack',
    [LARGE_CLASS]: 'spuType_large_class',
    [BAN_TAK]: 'spuType_class',
    [EXERCISE]: 'spuType_practice',
    [ENTITY_GOODS]: 'spuType_entity',
    [SVIP]: 'spuType_svip',
    [VALUE_COUPON]: 'spuType_coupon',
    [AI_CLASS]: 'spuType_AI_class',
    [SERVICE_GOODS]: 'spuType_serviceGoods',
    [ACTIVITY_MANAGE]:'spuType_activitymanage',
    [COURSE]: 'spuType_Course'
}

// 有SKU选择器的商品类型
export const TYPE_WITH_MULTI_SKU = [ENTITY_GOODS, OFFLINE_CLASS, OFFLINE_PERIOD, VALUE_COUPON, SERVICE_GOODS]
// 不区分商品类型，页面埋点常量
export const SENSORS_MAP = {
    DETAIL_PAGE: 'c***xh572'
}

// 神策埋点常量--详情页
export const SENSORS_DETAIL_PAGE = {
    [ENTITY_GOODS]: 'c***xh531',
    [OFFLINE_CLASS]: 'c***xh534',
    [OFFLINE_PERIOD]: 'c***xh535'
}

// 神策埋点常量--下单页
export const SENSORS_PAY_PAGE = {
    [ENTITY_GOODS]: 'c***xh532'
}

// 神策埋点常量--选择学员弹框
export const SENSORS_STUDENT_SELECTED_POPUP = {
    [OFFLINE_CLASS]: 'c***xh538',
    [OFFLINE_PERIOD]: 'c***xh537',
}

// 神策埋点常量--sku弹框
export const SENSORS_SKU_POPUP = {
    [OFFLINE_CLASS]: 'c***xh536',
}

export const RESOURCE_TYPES_MAP = {
    'IMG_TEXT': 'ITX',
    'AUDIO': 'ADO',
    'VIDEO': 'VDO',
    'LIVE': 'ALV',
    'MEMBER': 'MMB',
    'SPECIAL_COLUMN': 'SPC',
    'ASSOCIATION': 'CMN',
    'BIG_SPECIAL_COLUMN': 'BSC',
    'PUNCH_CARD': 'PCD',
    'E_BOOK': 'EBK',
    'TRAINING_CAMP': 'TCP',
    'TRAINING_CAMP_PRO': 'EKC', // 训练营
    'OFFLINE_CLASS': 'OLC',
    'OFFLINE_PERIOD': 'OLP',
    'BAN_TAK': 'BTK',
    'LARGE_CLASS': 'LGC',
    'EXERCISE': 'ECS',
    'ENTITY_GOODS': 'ENT',
    'SVIP': 'SVP',
    'VALUE_COUPON': 'VCP',
    'AI_CLASS': 'ALC',
    'SERVICE_GOODS': 'SRV',
    'ACTIVITY_MANAGE' : 'ATV',
};

// 营销活动标签
export const MARKETING_TYPES = {
    [MARKETING_LIMIT_DISCOUNT]: $t('marketActivity_limitedDiscounts'),
    [MARKETING_FRIEND_HELP]: $t('marketActivity_friendsHelp'),
    [MARKETING_FISSION_POSTER]: $t('marketActivity_post'),
    [MARKETING_TEAM_BUY]: $t('marketActivity_groupBuy'),
    [MARKETING_SEC_KILL]: $t('marketActivity_secKill'),
    [MARKETING_CUT_PRICE]: $t('marketActivity_bargain'),
    [MARKETING_SVIP]:$t('marketActivity_svip')
};

// 营销活动标签i18n keys
export const MARKETING_TYPES_TKEYS = {
    [MARKETING_LIMIT_DISCOUNT]: 'marketActivity_limitedDiscounts',
    [MARKETING_FRIEND_HELP]: 'marketActivity_friendsHelp',
    [MARKETING_FISSION_POSTER]: 'marketActivity_post',
    [MARKETING_TEAM_BUY]: 'marketActivity_groupBuy',
    [MARKETING_SEC_KILL]: 'marketActivity_secKill',
    [MARKETING_CUT_PRICE]: 'marketActivity_bargain',
    [MARKETING_SVIP]:'marketActivity_svip'
}

export const OLC_TYPE = {
    1: $t('One_to_many'),
    2: $t('One_to_one')
}

export const MARKETING_TYPES_NUMS = {
    'MARKETING_LIMIT_DISCOUNT': 3,
    'MARKETING_FRIEND_HELP': 4,
    'MARKETING_FISSION_POSTER': 5,
    'MARKETING_TEAM_BUY': 6,
    'MARKETING_SEC_KILL': 8,
    'MARKETING_CUT_PRICE': 10,
    'MARKETING_SVIP': 23
};

// 跳转链接
export const JUMP_URL = {
    home: '/homepage',
    serch: '/apprnDA0ZDw4581/search',
    person_center: '/homepage/30',
}

export const PACKAGE_ORDER_TYPE = {
    "offline_package_pay_value" : 2,
    "offline_return_pay_value" : 3
}

export const PAYMENT = {
    "2": "offline_package_pay_value",
    "3": "offline_return_pay_value"
};

export const OFFLINE_SALE_MODE = {
    "PERIOD": 1, //按课时
    "DURATION": 2, //按时段
    "CLASS": 3, //按期
    "COURSE_PACKAGE": 4 //按课包
}

export const PAYMENT_VALUE = {
    "offline_package_pay_value": $t('class_hours'),
    "offline_return_pay_value": $t('return_class_hours')
};

export const PAYMENT_VALUE_TKEYS = {
    "offline_package_pay_value": 'class_hours',
    "offline_return_pay_value": 'return_class_hours'
}

// 底部按钮中区别不同提示语的商品列席
export const BUTTON_DIFFERENT_TEXT = [
    ENTITY_GOODS,
    VALUE_COUPON,
    OFFLINE_PERIOD
]

// 短路由字段映射
export const SHORT_URL_PARAMS_MAP = {
    'resource_id': 'res_id',
    'resource_type': 'res_type',
    'product_id': 'pro_id',
    'content_app_id': 'ct_app_id'
};

// 各商品类型对应的 resource_type 值
export const RESOURCE_TYPES_TRANS = {
    "ITX": 1,
    "ADO": 2,
    "VDO": 3,
    "ALV": 4,
    "MMB": 5,
    "SPC": 6,
    "CMN": 7,
    "BSC": 8,
    "EBK": 20,
    "TCP": 25,
    "OLC": 29,
    "ENT": 21,
    "VCP": 41,
    "OLP": 42,
    "ALC": 45,
    'SRV': 68,
    'EKC': 50
};

// 商品无法购买异常类型
export const GOODS_INVALID_TYPE = {
    10023: $t('product_suspended_sale'),
    10026: $t('product_deleted'),
    10027: $t('product_removed'),
    10030: $t('product_soldOut'),
    50006: $t('product_specification_notExist'),
    50007: $t('Out_delivery_range')
}

//商品无法下单
export const GOODS_CONFIRM_INVALID_TYPE = {
    10023: "商品已暂停售卖",
    10026: "商品已被删除",
    10027: "商品已下架",
    10030: "商品已售罄",
    10315: "请点击前往商品详情购买",
    50003: "请点击前往商品详情购买",
    50004: "请点击前往商品详情购买",
    50005: "请点击前往商品详情购买",
    50006: "商品规格不存在",
    50007: "配送区域已更新，请重新选择收货地址并保存",
    50008: "设置了自提配送",
    50009: "加密课程，无需购买",
    50010: "未到报名时间，无法下单",
    50011: "报名已截止",
    50012: "免费课程，无需购买",
    50013: "关联售卖课程，无需购买",
    50014: "已拥有课程，无需购买",
    50015: "指定学员课程，无需购买",
    50016: "课程已满员",
    50017: "已有待付款订单，无法重复下单",
    50018: "请点击前往商品详情购买",
    50019: "商品库存不足",
    50020: "该商品已被删除，暂时无法购买",
    50021: "不同配送方式的商品不支持同时结算",
    50022: "商品无配送方式",
    50023: "超出限购数量",
    50024: "未达到起售条件",
};

// 商品无法购买异常类型i18n keys
export const GOODS_INVALID_TYPE_TKEYS = {
    10023: 'product_suspended_sale',
    10026: 'product_deleted',
    10027: 'product_removed',
    10030: 'product_soldOut',
    10306: 'product_groupPurchase_disabled',
    10308: 'product_activity_notStarted',
    10309: 'product_soldOut',
    10310: 'product_soldOut',
    10311: 'product_coupons_disabled',
    10042: 'product_svip_repeat_purchase',
    10050: 'product_coupons_disabled',
    10051: 'product_coupons_disabled',
    10052: 'product_coupons_disabled',
    10061003: 'product_personalInfoMissing',
    10061004: 'product_personalInfoMissing',
    20011: 'product_order_repeat',
    20012: 'product_quantity_limit',
    30008: 'not_logged_in',
    50006: 'product_specification_notExist',
    50007: 'Out_delivery_range',
    50023: 'product_quantity_limit',
    50024: 'product_saleCondition_disabled',
    // 其他错误的国际化统一用这个
    error: 'product_payment_exception',
}

// 支持超级会员的商品类型
export const SVIP_SPU_TYPE = [
    IMG_TEXT,
    AUDIO,
    VIDEO,
    E_BOOK,
    SPECIAL_COLUMN,
    BIG_SPECIAL_COLUMN,
    TRAINING_CAMP,
    TRAINING_CAMP_PRO,
    MEMBER,
    BAN_TAK,
    VALUE_COUPON,
    ENTITY_GOODS,
    OFFLINE_CLASS,
    AI_CLASS,
    OFFLINE_PERIOD
]

// ios端需要屏蔽支付的商品类型
export const IOS_FORBIDDEN_TYPE = [
    IMG_TEXT,
    AUDIO,
    VIDEO,
    E_BOOK,
    SPECIAL_COLUMN,
    BIG_SPECIAL_COLUMN,
    TRAINING_CAMP,
    TRAINING_CAMP_PRO,
    MEMBER,
    AI_CLASS,
    ASSOCIATION,
    PUNCH_CARD,
    SERVICE_GOODS,
    PRACTICE,
    VALUE_COUPON,
    OFFLINE_PERIOD
]

// 可多次拼团的商品类型
export const MULTIPLE_TEAM_BUY_TYPE = [
    ENTITY_GOODS,
    VALUE_COUPON,
    OFFLINE_PERIOD,
    OFFLINE_CLASS
]

// SKU选择器内要显示数量选择器的商品类型
export const SHOW_COUNTER_TYPE = [
    ENTITY_GOODS,
    VALUE_COUPON,
    SERVICE_GOODS
]

// 地址栏的警告提醒信息
export const ADDRESS_INVALID_TYPE = {
    'address_cancellation': $t('address_cancellation'),            // msg: 收货地址已作废，请选择有效的收货地址       code：1
    'address_update': $t('address_update'),                        // msg: 配送区域更新，请重新编辑                  code：101
    'address_freight_notSet': $t('address_freight_notSet'),        // msg: 商家未设置运费，计算异常，请联系商家！     code：102
    'address_notSupported_delivery': $t('address_notSupported_delivery'),   // msg: 该地址不支持配送，请重新选择              code：103
    'address_phone_error': $t('address_phone_error'),  // msg：手机号码格式有误，请重新输入
}

// ios端组合商品允许购买的商品类型
export const IOS_AGREE_TYPE = [
    LIVE,
    BAN_TAK,
    ENTITY_GOODS
]